package com.modakai.med.enums;

import lombok.Getter;

@Getter
public enum HospitalSetStatusEnum {

    //设置状态 1 使用 0 不能使用
    USE(1, "使用"),
    NOT_USE(0, "不能使用");
    private final Integer status;
    private final String description;

    HospitalSetStatusEnum(Integer status, String description) {
        this.status = status;
        this.description = description;
    }

    /**
     * 校验状态码是否正确
     * @param status 状态值
     */
    public static void validateStatus(Integer status) {
        for (HospitalSetStatusEnum hospitalSetStatusEnum : HospitalSetStatusEnum.values()) {
            if (hospitalSetStatusEnum.getStatus().intValue() == status.intValue()) {
                return;
            }
        }
        throw new RuntimeException("状态值错误");
    }
}
